﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "IEventArgs.h"

namespace gcmp
{
    /// \brief 事务事件类型
    ///
    enum TransactionEventType : int32_t
    {
        PreCommit,   ///< Commit操作执行之前
        PostCommit,   ///< 执行完Commit操作
        PostRollBack,  ///< 执行完RollBack操作
        PostStart      ///< 成功启动事务
    };

    /// \brief  事务事件参数
    ///
    FINAL_INTERFACE class GCMP_MODEL_INTERFACE_EXPORT ITransactionEventArgs : public IEventArgs
    {
        DEFINE_CAST_DERIVED(gcmp::ITransactionEventArgs, gcmp::IEventArgs);
    public:

        ///  \brief 获取事务事件类型
        ///
        /// \return 事务事件类型
        virtual TransactionEventType GetType() const = 0;
    };
}
